# -*- coding: utf-8 -*-#
#-------------------------------------------------------------------------------
# 建立者:        黄周云  
# Name:         test04
# Description:   例23.4
# Author:       ASUS
# Date:         2019/4/4
#-------------------------------------------------------------------------------


from numpy import *
#一维转多维,参数代表的是每一维的元素个数
b = arange(24).reshape(2,3,4)
print(b)
print("-------------------------")

#多维转一维
b1 = b.ravel()
print(b1)
print("------------")
b2 = b.flatten()
print(b2)
print("-------------")

#任意维度的转变
b.shape = (6,4)
print(b)
print("-----------")
# b.resize = ((2,12)),会报错
print("-------------")

#数组转置
b3 = b.transpose()
print(b3)


